// storePackage/pages/fileDetail/fileDetail.js
import { queryHealthDetail } from "../../../service/onetoone_service"
Page({

    /**
     * 页面的初始数据
     */
    data: {
        detailId: null,
        detail: {},
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.setData({
            detailId: options.id,
        })
        this.queryHealthDetail();
    },
    queryHealthDetail() {
        wx.showLoading();
        queryHealthDetail(this.data.detailId).then(res => {
            console.log("JJLog:档案详情是===:" + JSON.stringify(res));
            wx.hideLoading();
            if (res.code == 200) {
                this.setData({
                    detail: res.data,
                })
            }
        }).catch(err => {
            wx.hideLoading();
            wx.showToast({
                title: err || "查询失败",
                icon: "none"
            })
            console.error("JJLog:queryHealthDetail", err);
        })
    },
    previewImg(e) {
        let url = e.currentTarget.dataset.url;
        wx.previewImage({
            current: url,
            urls: [url],
        })
    },



    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },






})